
<template>
	<view >
		<scroll-view scroll-y class="page">
			<cu-custom bgColor="bg-gradual-pink" :isBack="true">
				<block slot="backText"></block>
				<block slot="content">余额缴费</block>
			</cu-custom>
			<!-- list列表 -->
			<view style="padding: 0 10px 0  10px;">
				<view class="cu-list menu" >
					<view class="cu-item animation-slide-bottom" style="margin-top: 10px;" :style="[{animationDelay: '0.1s'}]">
						<view class="content">
							<text class="text-grey">缴费账号</text>
						</view>
						<view class="action">
							<input placeholder="请输入缴费账号" name="input" v-model="payFormModel.accCode"></input>
						</view>
					</view>
				</view>
			</view>
		<view class="padding flex flex-direction" v-if="this.payFormModel.accCode !== '' ">
			<button class="cu-btn bg-green lg"  @click="onQuery">缴费查询</button>
		</view>
		<view class="padding flex flex-direction" v-if="this.payFormModel.accCode == '' ">
			<button class="cu-btn bg-green lg"  @click="onBind">绑定账号</button>
		</view>


		</scroll-view>
	</view>
</template>

<script>
	import api from '@/api/api.js'
	import { ACCCODE } from "@/common/util/constants"
	export default {
		data() {
			return {
				toggleStatus: false,
				loading: false,
				payFormModel:{
					accCode:''
				}
			};
		},
		onLoad() {
			let accCode=this.$store.getters.accCode;
			if(accCode){
				this.payFormModel.accCode=accCode;
			}
		},
		created(){
			if(this.payFormModel.accCode){

			}else{
				let accCode = uni.getStorageSync(ACCCODE);
				if(accCode){
					this.payFormModel.accCode=accCode;
				}
			}
		},
		methods: {
			onQuery(){
				if(this.payFormModel.accCode){
					this.$Router.push({name:'payFeeDetail', params: this.payFormModel})
				}else{
					this.$tip.toast('请填写缴费账号');
					return;
				}
				/* uni.navigateTo({
					url: '/pages/user/useredit?item='+item
				}); */
			},
			onBind(){
				this.$Router.push({name:'accBind'})
			},
		}
	}
</script>

<style>

</style>
